-
Notifications
You must be signed in to change notification settings - Fork 74
[oauth2] Add isClosed and exception handling for closed state to oaut… #2089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Should we just not set |
Would also be fine for me. This would at least avoid the 'Null check operator used on a null value' error. Is it okay to make a fixup commit here? Or should I just amend my existing commit? |
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
PR HealthBreaking changes ✔️
This check can be disabled by tagging the PR with Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with Coverage ✔️
This check for test coverage is informational (issues shown here will not fail the PR). This check can be disabled by tagging the PR with API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
This check can be disabled by tagging the PR with License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
This check can be disabled by tagging the PR with |
@sigurdm friendly ping! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading this again see http.Client
doesn't have a isClosed()
method. That suggests to me the OauthClient also shouldn't. Usually you should know if the client has been closed or not from the state of your code.
I think it is valuable to remove the "_httpClient = null" from the close()
method. That should avoid the null pointer reference.
And yes, it is very fine to just push more commits to the same PR.
56aac36
to
83b8e6f
Compare
@sigurdm Thank you for the suggestions. I amended the commit and also adapted the commit message. The branch name doesn't fit 100%, but if that matters, I could open a new PR. |
The branch name has no effect. Don't mind that :) |
I see there is a lint triggering. Could you fix that? |
83b8e6f
to
19e3781
Compare
Done :) |
19e3781
to
f405a42
Compare
@sigurdm Hi, is there anything, I can do here besides rebasing from time to time? How and when is this change merged? |
Sorry for the wait - I think this is good! Could you bump the patch version of pkg oauth, and add a note to the CHANGELOG? |
f405a42
to
7ec426f
Compare
Thanks for all the work and patience! 2.0.5 is now published! |
Thank you, I'm proud to be part of this repo 😊 |
Revisions updated by `dart tools/rev_sdk_deps.dart`. tools (https://github.com/dart-lang/tools/compare/d0941a3..ce12670): ce126700 Mon Oct 20 21:50:45 2025 +0100 Danny Tuppeny Fix @failingTest not working correctly for out-of-band exceptions (dart-lang/tools#2216) 8bb94d88 Mon Oct 20 16:14:33 2025 +0200 Sebastian Stallenberger [oauth2] Add isClosed and exception handling for closed state to oaut… (dart-lang/tools#2089) webdev (https://github.com/dart-lang/webdev/compare/82b3855..b9c39c0): b9c39c00 Mon Oct 20 15:52:13 2025 -0400 Ben Konyi [ DWDS ] Refactor `AppInspector` to support both Chrome and Web Socket connections (dart-lang/webdev#2700) Change-Id: I1e989df7dbfcbc99afe7dfcd0920a8fb0be5e4db Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/456260 Commit-Queue: Konstantin Shcheglov <[email protected]> Auto-Submit: Danny Tuppeny <[email protected]> Reviewed-by: Devon Carew <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
Until now there is no way to detect whether an oauth2.Client is closed or not. This PR changes that.
There is now an isClosed field on the oauth2.Client.
A request on a closed client no longer leads to a 'Null check operator used on a null value' error, but instead an http.ClientException is thrown with a meaningful error message.
Contribution guidelines:
dart format
.Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.